package com.cy.myblog.model;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "tmultimedia")
public class Tmultimedia implements Serializable{

	/**
	 * 媒体文件实体类
	 */
	private static final long serialVersionUID = 4582493412941762777L;
	private String id;
	private String address;
	private Date uploadtime;
	private Tarticle article;
	
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 38)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public Date getUploadtime() {
		return uploadtime;
	}
	public void setUploadtime(Date uploadtime) {
		this.uploadtime = uploadtime;
	}
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "articleid")
	public Tarticle getArticle() {
		return article;
	}
	public void setArticle(Tarticle article) {
		this.article = article;
	}
	
	public Tmultimedia() {
		super();
	}
	
	public Tmultimedia(String id, String address, Date uploadtime,
			Tarticle article) {
		super();
		this.id = id;
		this.address = address;
		this.uploadtime = uploadtime;
		this.article = article;
	}
}
